#include "user_include.h"
#if 0
#define USART_BUFFER_SIZE 128
void printf(const char *__format, ...)
{
    static unsigned char TxBuf[USART_BUFFER_SIZE];
    va_list ap;
    va_start(ap, __format);

    memset(TxBuf, 0x0, USART_BUFFER_SIZE);

    /* 填充发送缓冲区 */
    vsnprintf((char *)TxBuf, USART_BUFFER_SIZE, (const char *)__format, ap);
    va_end(ap);
    int len = strlen((const char *)TxBuf);

    /* 往串口发送数据 */
    HAL_UART_Transmit_DMA(&huart1, (uint8_t *)&TxBuf, len);
    osDelay(5);
}
#endif

struct __FILE
{
        int handle;
};
FILE __stdout;
int fputc(int ch, FILE *f)
{
 HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);//更具实际情况更改驱动
         return (ch);
}